import QtQuick 2.0

BrightSquare {
    id:root
    width: 600
    height: 400
    property int  duration: 3000
    property Item ufo: ufo

    Image {
        anchors.fill: parent
        source: "assets/ufo_background.png"
    }

    MouseArea{
        id:getset
        anchors.fill: parent
        onClicked: {
            anim.stop()
            ufo.x = 20
            ufo.y = root.height-ufo.height
        }
    }

    ClickableImageV2{
       id: ufo
       x:20; y:root.height - height
       labelColor: "black"
       text:" Icy "
       source: "assets/ufo.png"
       onClicked: anim.restart()
    }

    ParallelAnimation {
        id: anim
        NumberAnimation {
            target: ufo
            properties: "y"
            to: 20
            duration: root.duration
        }
        NumberAnimation {
            target: ufo
            properties: "x"
            to: 400
            duration: root.duration
        }
    }
}
